<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateQhKaoshiResultsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('qh_kaoshi_results', function (Blueprint $table) {
            $table->id();
            $table->integer('knowledgeId', false, true)->comment('学科Id');
            $table->integer('userId', false, true)->comment('用户Id');
            $table->integer('seconds')->default(0)->comment('所用秒');
            $table->integer('score')->default(0)->comment('得分');
            $table->timestamps();
        });

        DB::statement("ALTER TABLE qh_kaoshi_results comment '考试结果'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('qh_kaoshi_results');
    }
}
